home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 6022 < prev    next >
Encoding:
Text File  |  1996-08-05  |  855 b   |  37 lines

  1. Path: aurora.LaTech.edu!usenet
  2. From: pluu@engr.LaTech.edu (PL)
  3. Newsgroups: comp.lang.c
  4. Subject: [Help] I can't find my error.
  5. Date: 22 Feb 1996 05:38:35 GMT
  6. Organization: LTU
  7. Message-ID: <4ggvgr$1b2@aurora.engr.LaTech.edu>
  8. Reply-To: pluu@engr.LaTech.edu
  9. NNTP-Posting-Host: pulsar.engr.latech.edu
  10.  
  11.  
  12. Hi, all;
  13. Could anyone please tell me why the following program won't work?
  14.  
  15.  
  16. *********************************************************
  17. /* This program will ask your name and age; and then
  18. will print your name and age for next year back */
  19.  
  20. #include <stdio.h>
  21.  
  22. main()
  23. {
  24.     char name;    
  25.     int  age, next_age; 
  26.  
  27.     printf("%s\n","Please enter your name and age: ");
  28.     scanf("%s%d\n", &name, &age);
  29.     next_age= age + 1;
  30.     printf("Hi, %s ,next year, you will be %d\n", name, next_age);
  31. }
  32. *********************************************************
  33.  
  34.  
  35. Thanks in advance....
  36.  
  37.